package com.cskaoyan.junit;

import com.cskaoyan.Account;
import com.cskaoyan.utils.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.junit.*;

import java.sql.SQLException;

public class Account1Test {

    // 测试方法
//    @Test
    public void testSelectById() throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        Account account = queryRunner.query("select * from account where id = ?", new BeanHandler<>(Account.class), 1);

        System.out.println(account);


    }


    @Test
    public void testSelectAll(){

        System.out.println("test01");
    }

    @Test
    public void test02(){

        System.out.println("test02");
    }



    @After
    public void after(){
        System.out.println("after...");
    }

    @Before
    public void before(){

        System.out.println("before...");
    }


    @AfterClass
    public static void afterClass(){
        System.out.println("AfterClass...");
    }

    @BeforeClass
    public static void beforeClass(){
        System.out.println("beforeClass...");
    }

}
